import React from 'react';
import { Table } from 'antd';
import type { TableProps } from 'antd';
interface DataType {
  key: string;
  name: string;
  age: number;
  address: string;
  tags: string[];
}



const LeftTable: React.FC = () =>{
  let ChildRef = React.createRef();
  const clickB = () => {
    ChildRef.current.showModal()
  }

  const columns: TableProps<DataType>['columns'] = [
    {
      title: '行号',
      dataIndex: 'name',
      key: 'name',
      width: 60,
      render: (text) => <a>{text}</a>,
    },
    {
      title: '条码',
      key: 'no',
      width: 120,
    },
    {
      title: '采集时间',
      ellipsis: true,
      key: 'updateTime',
      width: 160,
    },
    {
      title: '姓名',
      ellipsis: true,
      key: 'adminName',
      width: 120,
    },
    {
      title: '标本状态',
      ellipsis: true,
      key: 'contractType',
      width: 120,
    },
    {
      title: '性别',
      ellipsis: true,
      key: 'status',
      width: 80,
    },
    {
      title: '年龄',
      ellipsis: true,
      key: 'age',
      width: 80,
    },
    {
      title: '单位',
      ellipsis: true,
      key: 'number',
      width: 160,
    },
    {
      title: '签收人',
      ellipsis: true,
      key: 'number',
      width: 160,
    },
    {
      title: '就诊类型',
      ellipsis: true,
      key: 'number',
      width: 160,
    },
    {
      title: '病历号',
      ellipsis: true,
      key: 'number',
      width: 180,
    },
    {
      title: '床位号',
      ellipsis: true,
      key: 'number',
      width: 180,
    },
    {
      title: '临床诊断',
      ellipsis: true,
      key: 'number',
      width: 180,
    },
    {
      title: '急诊',
      ellipsis: true,
      key: 'number',
      width: 180,
    },
    {
      title: '标本类型',
      ellipsis: true,
      key: 'number',
      width: 180,
    },
    {
      title: '核收时间',
      ellipsis: true,
      key: 'number',
      width: 180,
    },
    {
      align: 'left',
      fixed: 'right',
      key: 'op',
      title: <div>操作</div>,
      render: () => {
        return <div style={{display: 'flex'}}>
          <a style={{textDecoration: 'underline'}}>标本核收</a>
        </div>;
      }
    },
  ];

  const data: DataType[] = [
    {
      key: '1',
      name: '张三',
      age: 32,
      address: 'New York No. 1 Lake Park',
      tags: ['nice', 'developer'],
    },
  ];

  return(<><Table<DataType> columns={columns} dataSource={data} scroll={{ x: 'max-content' }}/>
  </>)
}

export default LeftTable;
